<?php defined('SYSPATH') OR die('No direct access allowed.');

class mymenu_Core {
	
	public static function get_nested_subpages($page, $step=0, $numsteps=0){
		$r= '<ul class="indented_list">';
		foreach($page->children->as_array() as $child){
			$r.= '<li class="mp">';
			$r.= sigi::actionbox('page', $child->id);
			$r.= sigi::addbox(array(array('title'=>'add Subpage', 'link'=>'ext/page/form/input?parent_id='.$child->id)));
			
			$r.= html::anchor('ext/page/single/'.$child->id, $child->get_meta_object()->menutitle);		
			$r.= mymenu::get_nested_subpages($child);
			$r.= '</li>';	
		}
		$r.='</ul>';
		return $r;
	}
}